Skip to content

fix(pages): hydrate islands added while the dev server runs - #870

Merged
Brooooooklyn merged 6 commits into
voidzero-dev:mainfrom
liangmiQwQ:fix/islands-client-new-island
Nov 25, 2026
Merged

Brooooooklyn merged 6 commits into
voidzero-dev:mainfrom
liangmiQwQ:fix/islands-client-new-island

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

When an island page gains a new island import while the dev server is running, the new island never hydrates. The page HTML includes its data-island wrapper, but virtual:void-islands-client keeps serving the module it generated before the edit, so the island has no loader. Reloading doesn't help; only a server restart does. Reproduction: https://github.com/liang-demos/void-vue-island-hmr-repro

The island manifest now keeps a reference to the dev server and rebuilds the islands client entry in dev when:

  • a page transform records a new island, or an island that now resolves to a different file;
  • a recorded island file is deleted or comes back. The entry skips missing files, so one deleted island no longer stops the others from hydrating;
  • a Markdown page is saved with new island imports. Markdown pages emit their own wrappers, so no page transform records them.

A page that gains its first island also needs the islands client script. The renderer decides this from the page and layout sources, so it is now rebuilt when a page or layout changes. Production output is unchanged.

The React, Vue, Svelte and Solid adapters pass the server to the manifest from configureServer.

🤖 Generated with Claude Code

@cpojer

cpojer commented Nov 18, 2026

Copy link
Copy Markdown
Member

Two issues, slop explanation:

  • Removing an island can break unrelated islands. Add an island, remove its import and file, then add another island. The manifest keeps the deleted path, so Vite returns HTTP 500 when rebuilding the shared client entry. An existing counter stopped hydrating on the PR and kept working on base. Prune deleted components before emitting loaders and cover this edit sequence.
  • The first island on a static page is still missed. In Vue, adding the first island to a previously static .island.vue page produced its HTML wrapper but no hydration script, even after reload. This also fails on base. Refresh the renderer’s decision about whether the page needs client JavaScript when its imports change.

@liangmiQwQ
liangmiQwQ marked this pull request as ready for review November 18, 2026 14:09
@Brooooooklyn
Brooooooklyn self-requested a review November 25, 2026 08:38
@Brooooooklyn

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T09:20:28.700674Z bcf7622 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c66ff0967

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vue/src/plugin-islands.ts Resolved
- Rebuild the islands renderer when a page or layout changes, so a page
  that gains its first island gets the client script. This replaces the
  rendered-HTML `data-island=` check, which also ran in production and
  matched pages that only show that text.
- Skip a missing island file in the client entry without dropping it
  from the manifest, and rebuild the entry when a recorded island file
  is deleted or comes back.
- Record a Markdown page's islands when it is saved. Markdown pages emit
  their own wrappers, so no page transform records them.
- A page deleted before its islands are read is skipped instead of
  throwing.
- Tests: shared unit coverage in packages/void, fixture dirs from the
  shared helper, and no `server.listen()` (it started the optimizer).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Brooooooklyn

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: bcf7622d38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Brooooooklyn
Brooooooklyn merged commit 710736a into voidzero-dev:main Nov 25, 2026
24 of 26 checks passed
@liangmiQwQ
liangmiQwQ deleted the fix/islands-client-new-island branch November 25, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants